package com.ruoyi.xh.service.impl;

import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.xh.mapper.XhNoticeMapper;
import com.ruoyi.xh.domain.XhNotice;
import com.ruoyi.xh.service.IXhNoticeService;

/**
 * 公告通知Service业务层处理
 * 
 * @author songjw
 * @date 2024-12-13
 */
@Service
public class XhNoticeServiceImpl extends ServiceImpl<XhNoticeMapper,XhNotice> implements IXhNoticeService {

    /**
     * 查询公告通知
     * 
     * @param id 公告通知主键
     * @return 公告通知
     */
    @Override
    public XhNotice selectXhNoticeById(Long id)
    {
        return this.getById(id);
    }

    /**
     * 查询公告通知列表
     * 
     * @param xhNotice 公告通知
     * @return 公告通知
     */
    @Override
    public Page<XhNotice> selectXhNoticeList(XhNotice xhNotice)
    {
        return new Page<>();
    }

    /**
     * 新增公告通知
     * 
     * @param xhNotice 公告通知
     *
     */
    @Override
    public void insertXhNotice(XhNotice xhNotice)
    {
        this.save(xhNotice);
    }

    /**
     * 修改公告通知
     * 
     * @param xhNotice 公告通知
     *
     */
    @Override
    public void updateXhNotice(XhNotice xhNotice)
    {
        this.updateById(xhNotice);
    }

    /**
     * 批量删除公告通知
     * 
     * @param ids 需要删除的公告通知主键
     *
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteXhNoticeByIds(Long[] ids)
    {
        this.removeByIds(Stream.of(ids).collect(Collectors.toSet()));
    }
}
